<link rel="stylesheet" href="../core/resource/weui/weui.css">
<style type="text/css">
body{background:#eee}
.parent-category{float:left; width:100%; height:auto; min-height:100%;}
.parent-category ul{margin:0; padding:0; width:100%;}
.parent-category ul li{list-style:none; text-align:center; height:50px; line-height:50px; white-space:nowrap; width:100%; border-bottom:1px solid #e0e0e0; position:relative; right:-1px;}
.parent-category ul li.active{border-right:1px solid #fff; z-index: 10000}
.parent-category ul li a{display:inline-block; width:100%; height:100%; text-decoration:none;}
.children-category{width:100%; min-height:100%; height:auto; color: #252525;}
.children-category ul{list-style:none; margin:0; padding:0; overflow-y:auto; overflow-x:hidden; border-left:1px solid #e0e0e0; min-height:100%;}
.children-category ul li{text-align:left; height: 32px; line-height: 32px; padding-left: 10px}
.children-category ul li.delivery-tips{height:25px; line-height:25px; margin-top: -15px; font-size: .65rem; color: #ff2d4b}
.children-category ul li a{display:inline-block; width:100%; height:100%; text-decoration:none;}
.children-category ul li a span{font-size: .6rem; color: #999;}
.children-category .block{display:block; color:#ef1e15; font-size:.6rem;}
</style>
<div class="fe-mod-9" style="height:11rem;min-height:6rem">
     <div id="l-map" style="height: 11rem;padding:0px 0px;"></div>
	<div class="group-top" style="background:rgba(0,0,0,0.3);position: absolute;top:7rem;width:100%">
     <div class="fui-list jump text-center">
          <a class="fui-list-inner" href="">
             <div class="title" style="color: #fff;margin:0.8rem 0 0.3rem 0">{{pagedata.store.title}}</div>
			 <div class="subtitle" style="color: #fff;font-size:0.55rem">已成交订单总数：{{pagedata.ordernum || 0}} | 已上架菜品总数：{{pagedata.goodsnum || 0}}</div>
             <div class="subtitle" style="color: #f60;font-size:0.4rem">{{pagedata.store.desc}}</div>
           </a>
      </div>
	</div>
    <div class="fe-mod-9-shoplogo" style="top:4rem"> 
        <div class="fe-mod-9-shoplogo-img" style="">
            <img src="{{tomedia(pagedata.store.logo) || '../core/resource/images/nopic.jpg'}}">
        </div>
    </div>
</div>
<div class="weui_cells_title" style="background-color: #fff;border-bottom: 1px dashed #fafafa;margin-bottom:0;padding-top:10px"><i class="icon jinyunicon icon-dianpu" style="font-size:0.76rem"></i>商家服务</div>
<div class="fui-icon-group noborder col-5" style="background-color: #fff;">
                <div class="fui-icon-col external"  href="javascript:;" onclick="$('#selecttable').modal();"  ng-show="pagedata.store.dish_type.indexOf(';1;')>=0">
                    <div class="badge"></div>
                    <div class="icon icon-green radius"><i class="icon jinyunicon icon-shitangdiancan" style="color:#f60"></i></div>
                    <div class="text">堂点</div>
                </div>
				<div class="fui-icon-col external" href="javascript:;" ng-show="pagedata.store.dish_type.indexOf(';2;')>=0" ng-click="post('','out')">
                    <div class="badge"></div>
                    <div class="icon icon-green radius"><i class="icon jinyunicon icon-waimai" style="color:#f60"></i></div>
                    <div class="text">外卖</div>
                </div>
				<div class="fui-icon-col external" href="javascript:;" ng-show="pagedata.store.dish_type.indexOf(';3;')>=0" ng-click="post('','self')">
                    <div class="badge"></div>
                    <div class="icon icon-green radius"><i class="icon jinyunicon icon-ziqu orange" style="color:#f60"></i></div>
                    <div class="text">自取</div>
                </div>
				<div class="fui-icon-col external" href="javascript:;" ng-show="pagedata.store.dish_type.indexOf(';4;')>=0" ng-click="post('','queue')">
                    <div class="badge"></div>
                    <div class="icon icon-green radius"><i class="icon jinyunicon icon-paihao0" style="color:#f60"></i></div>
                    <div class="text">排队</div>
                </div>
				<div class="fui-icon-col external" href="javascript:;" ng-show="pagedata.store.dish_type.indexOf(';5;')>=0" ng-click="post('','yuding')">
                    <div class="badge"></div>
                    <div class="icon icon-green radius"><i class="icon jinyunicon icon-yuyue" style="color:#f60"></i></div>
                    <div class="text">预定</div>
                </div>
</div>
<div class="weui_cells weui_cells_access">
            <a class="weui_cell">
                <div class="weui_cell_hd"><i class="icon jinyunicon icon-shijian" style="font-size:0.9rem"></i></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <span>营业时间：{{pagedata.store.time.start}}点 ~ {{pagedata.store.time.end}}点</span>
                </div>
               
            </a>
            <a class="weui_cell">
                <div class="weui_cell_hd"><i class="icon jinyunicon icon-ditu" style="font-size:0.9rem"></i></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <span>商家地址：{{pagedata.store.address}}</span>
                </div>
              
            </a>
			<a class="weui_cell">
                <div class="weui_cell_hd"><i class="icon jinyunicon icon-phone" style="font-size:0.9rem"></i></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <span>电话：{{pagedata.store.mobile}}</span>
                </div>
            </a>
			<a class="weui_cell">
                <div class="weui_cell_hd"><i class="icon jinyunicon icon-fuwuchuanga" style="font-size:0.9rem"></i></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <span>温馨服务：</span><span ng-repeat="(key,value) in pagedata.services" class="label label-primary" style="margin-right:0.3rem">{{value}}</span>
                </div>
            </a>
</div>
<div id="selecttable"  class="modal fade" tabindex="-1" style="z-index: 99999; display: none;">
	<div class="modal-dialog" style="width:90%;top:20%;left:5%;">
	<div class="modal-content" style="border-radius: 4px;">
		<div aria-hidden="true" data-dismiss="modal" class="closebtn"><i class="icon jinyunicon icon-wrong"></i></div>
		<div ng-if="pagedata.selecttable !=1 " class="fui-line" style="width:6rem;margin:0.5rem auto 0 auto">
			<div class="text text-danger" style="background-color:#fff" >点餐方式</div>
		</div>
		<div ng-if="pagedata.selecttable ==1 " class="fui-line" style="width:6rem;margin:0.5rem auto 0 auto">
			<div class="text text-danger" style="background-color:#fff" >选择餐桌</div>
		</div>
		<div ng-if="pagedata.selecttable !=1 " class="fui-icon-group noborder col-2">
						<div class="fui-icon-col external" href="javascript:;" ng-click="scancode()">
							<div class="badge"></div>
							<div class="icon icon-green radius"><i class="icon jinyunicon icon-scanning"></i></div>
							<div class="text">扫码点餐</div>
						</div>
						<div class="fui-icon-col external"  href="javascript:;" ng-click="pagedata.selecttable=1">
							<div class="badge"></div>
							<div class="icon icon-green radius"><i class="icon jinyunicon icon-templatedefault"></i></div>
							<div class="text">选桌号点餐</div>
						</div>
		</div>
		<div ng-if="pagedata.selecttable ==1 " class="row margin0" style="height:300px">
			<div class="col-xs-3">
				<div class="parent-category" id="delivery-time-parent">
					<ul>
							<li ng-repeat="g in pagedata.tables" ng-class="{'orange':pagedata.gindex==$index}"><a href="javascript:;" ng-click="pagedata.post.group_id;pagedata.table_list=g.table_list;pagedata.groupname=g.title;pagedata.gindex=$index">{{g.title}}</a></li>
					</ul>
				</div>
			</div>
			<div class="col-xs-9" style="height:100%">
				<div class="children-category">
						<ul>
								<li class="time-flag"><a href="javascript:;" ng-click="scancode()" style="color: #ff2d4b"><i class="icon jinyunicon icon-saoyisao2"></i> 扫桌面二维码点餐</a></li>
								<li ng-repeat="item in pagedata.table_list" ng-click="pagedata.post.table_id=item.id;pagedata.index=$index">
									<a ng-class="{'orange':pagedata.indexid==item.id}" style="font-size:1.0rem" href="javascript:;">{{item.title}}<span style="font-size:0.65rem" >({{pagedata.groupname}})</span></a>
								</li>
						</ul>
				</div>
			</div>
		</div>
		<div ng-if="pagedata.selecttable ==1 " class="modal-footer">
			<div class="mod-check" href="javascript:" ng-click="post(pagedata.post,'table')" aria-hidden="true" data-dismiss="modal">开始点餐</div>
		</div>
		</div>
	</div>
</div>
<script language="javascript">
scope.scancode = function(){
	console.log('scancode');
			wx.scanQRCode({
				needResult: 1, // 默认为0，扫描结果由微信处理，1则直接返回扫描结果，
				scanType: ["qrCode","barCode"], // 可以指定扫二维码还是一维码，默认二者都有
				success: function (res) {
					var result = res.resultStr; // 当needResult 为 1 时，扫码返回的结果
					//location.href= result;					
				}
			});
}
</script>
	<script type="text/javascript">
	// 百度地图API功能
	require(['map'], function(BMap){
		var map = new BMap.Map("l-map");
		var lng=scope.pagedata.store.lat_lng.lng ? scope.pagedata.store.lat_lng.lng : '113.941134';
		var lat=scope.pagedata.store.lat_lng.lat ? scope.pagedata.store.lat_lng.lat : '22.546011';
		var point = new BMap.Point(lng, lat);
		map.centerAndZoom(point, 15);
		// 编写自定义函数,创建标注
		function addMarker(point){
		  var marker = new BMap.Marker(point);
		  map.addOverlay(marker);
		}
		addMarker(point);
	});
	</script>
<div ng-include="sys_html('_footer')"></div>